.size(@width; @height) {
  width: @width;
  height: @height;
}

.circle(@size) {
  .size(@size, @size);
  border-radius: 50%;
}

.clearfix() {
  &::before,
  &::after {
    content: " ";
    display: table;
  }
  &::after {
    clear: both;
  }
}

.center-block() {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.text-overflow() {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.img-responsive(@display: block) {
  display: @display;
  max-width: 100%;
  height: auto;
}

.bg-variant(@color) {
  background-color: @color;

  a&:hover {
    background-color: darken(@color, 10%);
  }
}
.text-emphasis-variant(@color) {
  color: @color;

  a&:hover {
    color: darken(@color, 10%);
  }
}

.placeholder(@color) {
  &::-moz-placeholder {
    color: @color;
    opacity: 1;
  }
  &:-ms-input-placeholder { color: @color; }
  &::-webkit-input-placeholder { color: @color; }
}

/* Flex
------------------*/
// 纵轴
.flex-y() {
  display: flex;
  flex-direction: column;
}
// 多行
.flex-wrap() {
  flex-wrap: wrap;
}
// X轴水平居中
.flex-x-center() {
  display: flex;
  justify-content: center;
}
// X轴垂直居中
.flex-x-middle() {
  display: flex;
  align-items: center;
}
// X轴两端对齐
.flex-x-between() {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
// X轴水平垂直居中
.flex-x-center-middle() {
  display: flex;
  justify-content: center;
  align-items: center;
}
// Y轴垂直居中
.flex-y-middle() {
  .flex-y;
  align-items: center;
}
// Y轴水平居中
.flex-y-center() {
  .flex-y;
  justify-content: center;
}
// Y轴水平垂直居中
.flex-y-center-middle() {
  .flex-y;
  justify-content: center;
  align-items: center;
}
// Y轴两端对齐
.flex-y-between() {
  .flex-y;
  justify-content: space-between;
}
// 子项固定宽或高
.flex-item() {
  flex-shrink: 0;
}
// 子项自适应宽或高
.flex-item-auto() {
  flex: 1;
}
